<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H5页面</title>
</head>
<body>
<div>H5页面</div>
<button onclick="login()">H5调用原生登录方法</button>
<button onclick="callPhone()">H5调用原生打电话方法</button>

<h2 id="msgContent" style="color: Orange; font-size: 20px;"></h2>
<h2 id="token" style="color: Orange; font-size: 20px;"></h2>
<div id="ele"></div>
<script>
    //登录方法
    function login(){
      if(window.taike){
      //H5页面调用原生登录
         window.taike.login()
       }
    }

    //打电话方法
    function callPhone(){
        if(window.taike){
      //H5页面调用原生登录
         window.taike.callPhone("13588888888")
       }
    }
      //发送文字
     function sendToH5Msg (msg) {
      document.querySelector("#msgContent").innerText = '原生调用H5方法传递的参数是：'+msg
     }
     //发送html标签
     function sendHtml(htmlEle){
       document.querySelector("#ele").innerHTML = htmlEle
    }
     //原生登录成功之后  调用登录成功返回token
    function loginSuccess(token){
       document.querySelector("#token").innerText = '原生传过来的token是：'+token
    }
</script>
</body>
</html>